import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        redirect: '/list',
    },
    {
        path: '/list',
        component: () =>
            import(/* webpackChunkName: "memo" */ '../views/List.vue'),
    },
    {
        path: '/add',
        component: () =>
            import(/* webpackChunkName: "memo" */ '../views/Add.vue'),
    },
    {
        path: '/mine',
        component: () =>
            import(/* webpackChunkName: "memo" */ '../views/Mine.vue'),
    },
    {
        path: '/detail/:id',
        component: () =>
            import(/* webpackChunkName: "memo" */ '../views/Detail.vue'),
    },
];

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes,
});

export default router;
